package com.kehutong.payfees.admin;

//import java.util.ArrayList;
//import java.util.Arrays;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
//import com.kehutong.payfees.service.LawyerEvidenceFileServiceImpl;
//import org.coraframework.authz.HasPermission;
//import org.coraframework.inject.Inject;
//import org.coraframework.mvc.MvcAction;
//import org.coraframework.mvc.http.ReqMapping;
//import org.coraframework.mvc.http.result.Result;
//import org.coraframework.orm.jdbc.SQLSession;
//
//import com.kehutong.payfees.entity.LawyerEvidenceFile;
//import com.kehutong.payfees.enums.EvidenceType;
//
//@MvcAction
//@ReqMapping("/admin/charge/lawyer/evidence")
//public class LawyerEvidenceFileAction {
//
//    @Inject
//    private SQLSession sqlSession;
//
//    @Inject
//    private LawyerEvidenceFileServiceImpl lawyerEvidenceFileService;
//
//    @HasPermission("charge:mediation:view")
//    @ReqMapping("/list")
//    public Object getLawyerEvidence(String id) {
//        return Result.success(lawyerEvidenceFileService.getLawyerEvidence(id));
//    }
//
//    @HasPermission("charge:mediation:view")
//    @ReqMapping("/enums")
//    public Object getEnums() {
//        List<EvidenceType> evidenceTypes = Arrays.asList(EvidenceType.values());
//        List<EvidenceType> applicantEvidenceTypes = new ArrayList<>();
//        List<EvidenceType> respondentEvidenceTypes = new ArrayList<>();
//        evidenceTypes.forEach(evidenceType -> {
//            if (evidenceType.getId().substring(0,1).equals("1")) {
//                applicantEvidenceTypes.add(evidenceType);
//            }else {
//                respondentEvidenceTypes.add(evidenceType);
//            }
//        });
//        Map<String, List<EvidenceType>> map = new HashMap<>();
//        map.put("applicant", applicantEvidenceTypes);
//        map.put("respondent", respondentEvidenceTypes);
//        return Result.success(map);
//    }
//
//    @HasPermission("charge:mediation:edit")
//    @ReqMapping("/save")
//    public Object saveLawyerEvidence(LawyerEvidenceFile lawyerEvidenceFile) {
//        lawyerEvidenceFileService.saveLawyerEvidence(lawyerEvidenceFile);
//        return Result.success();
//    }
//
//    @HasPermission("charge:mediation:edit")
//    @ReqMapping("/delete")
//    public Object deleteLawyerEvidence(String id) {
//        lawyerEvidenceFileService.deleteLawyerEvidence(id);
//        return Result.success();
//    }
//}
